The present invention relates to database workload balancing.
For various economic and business reasons enterprises are increasingly centralizing their backend computer systems in purpose built data centers. Data centers typically house high concentrations and densities of such computer systems and additionally provide databases to support customer needs. Data center operators have to make the decision to purchase the server boxes up-front and then provision resources on ever changing workload. Further, multiple different workloads may share resources on the same physical box and provisioning the workload requires taking into account physical constraints such as capacity constraints associated with the physical resources. The recent move towards cloud computing for data intensive computing presents unique opportunities and challenges for data center operators.
One key challenge that data center operators face is the provisioning of resources in the data center for specific customer workloads. For example, with a new server added, each existing server “donates” a set of masters and slaves to be migrated to the server so that                there is no master-slave co-located on the new server,        master-to-slave ratio are about the same across all the servers,        memory capacities and CPU capacities are as balanced as possible across all the servers,        amount of data being moved is minimal.        
Another problem is hotspot elimination. For a given configuration of servers, if there are overloaded servers (a server is overloaded if it is a memory hotspot or a CPU hotspot, or both), resolve the overloading servers by migrating out one master from each overloaded server.
Federated databases have been used where relations are split manually among different servers and a unified view is exposed to the clients. However, such a solution involves manual configuration, special merging and wrapper algorithms, and does not support dynamic rebalancing.
Another solution is to add and remove slave databases based on workloads. However, because slave databases (replicas) only support read queries and all the write queries have to go to the master, such a solution can be ineffective when the workload contains many write queries. In addition, adding slaves takes very long time, and so this solution is not able to handle quick workload changes.
Other approaches have assumed that the workloads are different for a master DB and its slaves. Therefore, the workload is balanced through swapping the roles or master and slave. However, such method is only effective when the workloads at master and slaves are greatly different and the swapping is supported by the underlying DB system. In another method, the load balancing is achieved by (a) changing resource allocation among different virtual machines at the same server and (b) adding and removing servers. However, the method assumes each DB instance is wrapped within a single virtual machine and each server must contain all DBs (either all masters of all DBs, or one slave from each DB), thus limiting the applicability of the method.